{% extends 'base.html' %}
{% load static %}

{% block title %} - 资料下载{% endblock %}

{% block css %}
<link rel="stylesheet" href="{% static 'css/about.css' %}">
<style>
    /* 新版样式 */
    .about-container {
        display: grid;
        grid-template-columns: 1fr 380px;
        gap: 2rem;
        min-height: calc(100vh - 120px);
        padding: 2rem;
    }

    .image-container {
        position: relative;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    }

    .image-container img {
        width: 45%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        transition: transform 0.3s ease;
    }

    .image-container:hover img {
        transform: scale(1.02);
    }

    .download-panel {
        background: white;
        border-radius: 12px;
        padding: 2rem;
        box-shadow: 0 8px 24px rgba(0,0,0,0.05);
        position: sticky;
        top: 2rem;
        height: fit-content;
    }

    .download-header {
        border-bottom: 2px solid #f0f2f5;
        padding-bottom: 1.5rem;
        margin-bottom: 2rem;
    }

    .download-header h2 {
        color: #2c3e50;
        font-size: 1.5rem;
        margin: 0;
    }

    .download-item {
        display: flex;
        align-items: center;
        padding: 1rem;
        margin: 0.5rem 0;
        background: #f8f9fa;
        border-radius: 8px;
        transition: all 0.2s;
        text-decoration: none;
        color: #34495e;
    }

    .download-item:hover {
        background: #e9ecef;
        transform: translateX(5px);
    }

    .download-icon {
        width: 32px;
        height: 32px;
        margin-right: 1rem;
        background: #3498db;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
    }

    @media (max-width: 992px) {
        .about-container {
            grid-template-columns: 1fr;
            padding: 1rem;
        }

        .download-panel {
            position: static;
            margin-top: 2rem;
        }
    }
</style>
{% endblock %}

{% block aboutHighlight %}active{% endblock %}

{% block main_block %}
<div class="about-container">
    <!-- 图片展示区 -->
    <div class="image-container">
        <img src="{% static 'images/beijing.jpg' %}" alt="实验室规章制度">
        <div class="image-overlay"></div>
    </div>

    <!-- 下载面板 -->
    <div class="download-panel">
        <div class="download-header">
            <h2>资料下载中心</h2>
            <p class="text-muted mt-2">点击下载相关文件</p>
        </div>

        <div class="download-list">
            {% for doc in docList %}
            <a href="{% url 'Lab:download_file' doc.id %}" class="download-item">
                <div class="download-icon">
                    <i class="fas fa-file-pdf"></i>
                </div>
                <div>
                    <div class="file-name">{{ doc.file_name }}</div>
{#                    <small class="text-muted">更新于 {{ doc.upload_date|date:"Y-m-d" }}</small>#}
                </div>
            </a>
            {% endfor %}
        </div>
    </div>
</div>
{% endblock %}